package io;

/** 字节流FileOutputStream写简易记事本
 */
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class test {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note.txt" );
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入内容,单独输入exit退出:");
       while (true){
        String input=scan.nextLine();//用户输入
          if ("exit".equalsIgnoreCase(input)){ //忽略大小写比较字符串
              break;
          }
         fos.write(input.getBytes(StandardCharsets.UTF_8));
       }
       fos.close();


         }
   }

